<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../libs/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../../libs/app.css" />
		<link href="../../css/main.css" rel="stylesheet" />
		<link href="../../css/assess-d.css" rel="stylesheet" />
	</head>

	<body>
		<div class="head">
			<img class="mui-action-back" src="../../images/all-left.png" alt="">
			<p>按揭垫资</p>
		</div>
		<div class="content">
			<!--列表-->
			<div class="list">
				
				<!--按揭垫资-->
				<div class="mui-table-view">
					<div class="mui-table-view-cell">
						<div class="lx-le">按揭垫资</div>
						<div class="lx-ri"><span class="bd-m lx-ri">元</span><input class="bd-ri" placeholder="单行输入" value=""></div>
					</div>
				</div>
				<!--还款期限-->
				<div class="mui-table-view">
					<div class="mui-table-view-cell">
						<div class="lx-le">还款期限</div>
						<div class="lx-ri"><span class="bd-m lx-ri">天</span><input class="bd-ri" placeholder="单行输入" value=""></div>
					</div>
				</div>
				
			<!--按钮-->
			<div>
				<!--<div class="add add-button">继续添加</div>-->
				<div class="add add-submit" id="evaluate">提交</div>
			</div>

		</div>

		<script src="../../libs/mui.min.js"></script>
		<script src="../../js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/url.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="../../js/assess-public.js" ></script>
		<script type="text/javascript">
               
//			提交^[0-9]+(.[0-9]{2})?$
			$('#evaluate').on('tap',function(){	
//				绑定数据
				var type = $('#info-lx').text();
				var number = $('.number').val();
                var price = $('.bd-ri').val();
				var month = $('#payment-y').text();
				var sub = $('#payment-c').text();
				var stage = $('#infoone').text();
				var baodan=/^[0-9]*$/;
				var yuan = /^[0-9]+(.[0-9]{3})?$/;
				if(!baodan.test(number)){
					mui.toast('请检查您的保单编号...');
					return;	
				}else if(!yuan.test(price)) {
					mui.toast('请检查您购买保单金额...');
					return;					
				}else if(type==''||type==null||type=='选择'||number==''||number==null||price==''||price==null||month==''||month==null||month=='选择'||sub==''||sub==null||sub=='选择'||stage==''||stage==null||stage=='选择'){
					mui.toast('请把信息填充完整...');
					return;					
				}else{		
					a();										
				}
//			接口		
				function a() {
					$.ajax({
						url: ur + "rest/loanController/evaluate",
						headers: {
							"X-Token": "027CEAAF9D6F451EAA0DF1D8F694C9E3"
						},
						dataType: "json",
						data: {
							loanCode: "rsbd",
							param: "[{type:'" + type + "',number:'" + number + "',price:" + price + ",month:" +month+ ",sub:" + sub + ",stage:"+stage+"}]",
						},
						type: "POST",
						success: function(data) {
						}
					});
					
				}	
			});

		
		</script>
	</body>

</html>